<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>

<script id="partition-header-template" type="text/x-kendo-template">
    <div class="dropdown-header k-widget k-header">
        <table>
            <thead>
            <tr>
                <td width="90px">分区名</td>
                <td width="90px">分区描述</td>
            </tr>
            </thead>
        </table>
    </div>
</script>
<script id="partition-template" type="text/x-kendo-template">
    <table>
        <tr>
            <td style="text-align: center;width:90px">#: data.ename#</td>
            <td style="text-align: center;">#: data.cname#</td>
        </tr>
    </table>
</script>
<script id="alertType-header-template" type="text/x-kendo-template">
    <div class="dropdown-header k-widget k-header">
        <table>
            <thead>
            <tr>
                <!--<td width="90px">ID</td>-->
                <td width="150px">报警名</td>
                <td width="150px">报警描述</td>
            </tr>
            </thead>
        </table>
    </div>
</script>
<script id="alertType-template" type="text/x-kendo-template">
    <table>
        <tr>
            <!--<td style="text-align: center;">#: data.alertId#</td>-->
            <td style="text-align: left;width:150px">#: data.alertName#</td>
            <td style="text-align: left;width:150px;">#: data.alertDesc#</td>
        </tr>
    </table>
</script>

<script id="user-header-template" type="text/x-kendo-template">
    <div class="dropdown-header k-widget k-header">
        <table>
            <thead>
            <tr>
                <td width="90px">工号</td>
                <td width="90px">姓名</td>
            </tr>
            </thead>
        </table>
    </div>
</script>
<script id="user-template" type="text/x-kendo-template">
    <table>
        <tr>
            <td style="text-align: center;width:90px">#: data.userId#</td>
            <td style="text-align: center;">#: data.userName#</td>
        </tr>
    </table>
</script>
<script type="text/x-kendo-template" id="gridEditor">
    <div class=" textboxes" >
        <div class="k-edit-label"><label>工号</label></div>
        <div class="k-edit-field">
            <input kendo-combo-box required
                   k-on-change="selectUser(dataItem,kendoEvent)"
                   k-data-text-field="'userId'"
                   k-data-value-field="'userId'"
                   k-data-source="userData"
                   k-header-template="userHeaderTmp"
                   k-template="userTmp"
                   ng-trim="true"
                   k-auto-width="true"
                   k-rebind="userData"
                   ng-model="dataItem.userId"/>
            <!--<input type="text" required  k-on-change="dataItem.dirty=true" class="k-input k-textbox" ng-model="dataItem.userId" />-->
        </div>
        <div class="k-edit-label"><label>报警类型</label></div>
        <div class="k-edit-field">
            <input kendo-combo-box required
                   k-on-change="dataItem.dirty=true"
                   k-data-text-field="'alertDesc'"
                   k-data-value-field="'alertId'"
                   k-data-source="alertTypeData"
                   k-header-template="alertTypeHeaderTmp"
                   k-template="alertTypeTmp"
                   ng-trim="true"
                   k-auto-width="true"
                   k-rebind="alertTypeData"
                   ng-model="dataItem.alertId"/>
            <!--<input type="text"  k-on-change="dataItem.dirty=true" class="k-input k-textbox" ng-model="dataItem.alertId" />-->
        </div>
        <div class="k-edit-label"><label>分区</label></div>
        <div class="k-edit-field">
            <input kendo-combo-box required
                   k-on-change="dataItem.dirty=true"
                   k-data-text-field="'ename'"
                   k-data-value-field="'ename'"
                   k-data-source="partitionData"
                   k-header-template="partitionHeaderTmp"
                   k-template="partitionTmp"
                   ng-trim="true"
                   k-auto-width="true"
                   k-rebind="partitionData"
                   ng-model="dataItem.partitionId"/>
        </div>
        <div class="k-edit-label"><label>功能号</label></div>
        <div class="k-edit-field">
            <input type="text" required  k-on-change="dataItem.dirty=true" class="k-input k-textbox" ng-model="dataItem.moduleName" />
            <a class="help" ng-mouseover="showPopover=true;" ng-mouseleave="showPopover=false;">
                <div class="popover" ng-show="showPopover">
                    <span>格式说明：</span>
                    <p>1.模块名：一级模块或二级模块 eg:AC或QMTP</p>
                    <p>2.电文号</p>
                </div></a>
        </div>
        <div class="k-edit-label"><label>发送方式</label></div>
        <div class="k-edit-field">
            <input kendo-combo-box required
                   k-on-change="dataItem.dirty=true"
                   k-data-source="sendTypeData"
                   k-data-text-field="'text'"
                   k-data-value-field="'value'"
                   ng-trim="true"
                   k-auto-width="true"
                   ng-model="dataItem.msgType"/>
        </div>
    </div>

</script>

<div style="margin-bottom: 20px;">
    <span style="font-size: 30px">报警订阅</span>
</div>
<div class="textboxes">

    <div class="form-inline group-margin">
        <div class="form-group">
            <label>工号:</label>
            <input kendo-combo-box
                   k-data-text-field="'userId'"
                   k-data-value-field="'userId'"
                   k-data-source="userData"
                   k-header-template="userHeaderTmp"
                   k-template="userTmp"
                   ng-trim="true"
                   k-auto-width="true"
                   k-rebind="userData"
                   ng-model="condition.userId"/>
            <!--<input class="k-input k-textbox" type="text" ng-trim="true" ng-model="condition.userId">-->
        </div>
        <div class="form-group">
            <label>报警类型:</label>
            <input kendo-combo-box
                   k-data-text-field="'alertDesc'"
                   k-data-value-field="'alertId'"
                   k-data-source="alertTypeData"
                   k-header-template="alertTypeHeaderTmp"
                   k-template="alertTypeTmp"
                   ng-trim="true"
                   k-auto-width="true"
                   k-rebind="alertTypeData"
                   ng-model="condition.alertId"/>
            <!--<input kendo-combo-box ng-model="condition.alertId">-->
            <!--<input kendo-auto-complete ng-trim="true" ng-model="condition.alertId" class="myinput">-->
        </div>
        <div class="form-group">
            <label>分区名称:</label>
            <input kendo-combo-box
                   k-data-text-field="'ename'"
                   k-data-value-field="'ename'"
                   k-data-source="partitionData"
                   k-header-template="partitionHeaderTmp"
                   k-template="partitionTmp"
                   ng-trim="true"
                   k-auto-width="true"
                   k-rebind="partitionData"
                   ng-model="condition.partitionId"/>

        </div>
        <div class="form-group">
            <label>功能名:</label>
            <input class="k-input k-textbox" ng-trim="true" ng-model="condition.moduleName">
        </div>
        <div class="form-group">
            <kendo-button class="k-primary" ng-click="query()">查询</kendo-button>
        </div>
    </div>
</div>
<!--k-on-data-bound="onDataBound(kendoEvent)"-->
<div class="table-responsive">
    <div kendo-grid="grid"
         k-column-menu="true"
         k-sortable="true"
         k-resizable="true"
         k-navigatable="true"
         k-pageable="pageable"
         k-filterable="true"
         k-editable="editable"
         k-selectable="'row'"
         k-toolbar="toolbar"
         k-columns="columns".66
         k-data-source="dataSource"
         k-on-change="gridRowClick({ selected: selected },data,dataItem,angularDataItem)"
         k-on-edit="gridRowEdit(kendoEvent)">

    </div>
</div>
